// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import Layout from './components/Layout'
import VueRouter from 'vue-router'
import VueResource from 'vue-resource'
import IndexPage from './pages/IndexPage'
import DetailPage from './pages/DetailPage'
import AnalysisPage from './pages/detail/AnalysisPage'
import CountPage from './pages/detail/CountPage'
import ForecastPage from './pages/detail/ForecastPage'
import PublishPage from './pages/detail/PublishPage'
import OrderListPage from './pages/OrderListPage'

Vue.config.productionTip = false
Vue.use(VueRouter)
Vue.use(VueResource)

let router = new VueRouter({
    mode: 'history',
    routes: [
        {
            path: '/',
            component: IndexPage
        },
        {
            path: '/orderList',
            component: OrderListPage
        },
        {
            path: '/detail',
            component: DetailPage,
            redirect: '/detail/analysis',
            children: [
                {
                    path: 'analysis',
                    component: AnalysisPage
                },
                {
                    path: 'count',
                    component: CountPage
                },
                {
                    path: 'forecast',
                    component: ForecastPage
                },
                {
                    path: 'publish',
                    component: PublishPage
                }
            ]
        }
    ]
})

/* eslint-disable no-new */
new Vue({
    el: '#app',
    router: router,
    components: {Layout},
    template: '<Layout/>'
})
